package org.nepu.scr.indexrate.converter.longevityrate;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.longevityrate.TestC41;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class TestC41Converter implements AttributeConverter<TestC41, String> {
    @Override
    public String convertToDatabaseColumn(TestC41 testC41) {
        return JSONUtil.toJsonStr(testC41);
    }

    @Override
    public TestC41 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, TestC41.class);
    }
}
